package io.github.talelin.latticy.bo;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @authoer:wulongbo
 * @createDate:2022/7/14
 * @description:
 */
@Data
@NoArgsConstructor
public class Student {
    private String name;
    // 分数只能在 0-100 之间
    private Integer score;

    public Student(String name, Integer score) {
        this.name = name;
        if (null == score || score < 0 || score > 100) {
            throw new RuntimeException("分数只能在0-100之间");
        }
        this.score = score;
    }
}
